package com.woniumall.web;

import com.woniumall.pojo.Massage;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @auther linke
 * @create 2021-10-30 10:33
 */
@WebServlet("/checkedCodeServlet")
public class CheckedCodeServlet extends BaseServlet {

    public void check(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        String checkCode = (String)req.getSession().getAttribute("checkCode");
        String str = checkCode.toUpperCase();
        String checkedCode = req.getParameter("checkedCode").toUpperCase();

        if (str.equals(checkedCode)){
//            String str = "{'checkCode':"+checkedCode+"}";
//            System.out.println(str);
            Massage msg = new Massage(true,"");
            responseUtil(resp,msg);
        }else {
            Massage msg = new Massage(false,"");
            responseUtil(resp,msg);
        }

    }


}
